using System;
using NUnit.Framework;
using WatiN.Core;

namespace PhillyCodeCampAcceptanceSpecs
{
    [TestFixture]
    public class when_zero_income_is_specified_and_the_calculate_button_is_invoked
    {
        [Test]
        public void should_display_zero_tax()
        {
            using (var ie = new IE(@"http://localhost:49344/TaxCalculator.aspx"))
            {
                ie.TextField(t => t.Name.Contains("_submissionDate")).TypeText(@"04/18/2009");
                ie.TextField(t => t.Name.Contains("_totalIncome")).TypeText("0");
                
                ie.Button( Find.ByName ( b => b.Contains("_submit"))).Click();

                Assert.IsTrue(ie.TextField(
                    t => t.Name.Contains("_calculatedTax")).Text.Contains("$"));
            }
        }
    }
}